package com.zj.study.filter;

import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebFilter;
import org.springframework.web.server.WebFilterChain;
import reactor.core.publisher.Mono;

/**
 *  webFlux拦截器
 *
 * @author 赵赳
 * @since 2021/12/15 9:33
 */
@Log4j2
@Component
public class WebFluxFilter implements WebFilter {

  @Override
  public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
    System.out.println("exchange = " + exchange);
    return chain.filter(exchange);
  }

}
